return "Drag to slider 'handle' to enable control of volume. Requires additional 'extent' member which limits the handle travel range." & RETURN & "PARAMETERS:" & RETURN & "ò Video Sprite - Enter the number of sprite channel in which video is displayed." & RETURN & "ò Extent Sprite - Enter the number of sprite channel that contains the 'extent' sprite." & RETURN & "ò Hilite Member - Member to display while handle is being dragged." & RETURN & "ò Dynamic - If set, volume will be updated while handle is dragged, else when handle is released."
end
on compute_val me
-- relies on tracking to update the currentScreenVal (different for Hor, Vert)
set val = 0.0
set val = float(the currentScreenVal of me) / float (the extentlength of me)
set val = val * the valrange of me
set val = val + the min of me
return val
end
on send_the_val me, val
-- sets the digital video volume to the val * paramter
set pMovieTime = val * pDuration
setvolume(sprite VideoSprite, pMovieTime-100)
end
on beginSprite me
set pDuration = 100
set the min of me = 0.0
set the max of me = 1.0
--
set handle = the spritenum of me
set the tracking of me = FALSE
set the newLocH of me = the locH of sprite handle
set the newLocV of me = the locV of sprite handle
set the newLocV of me = the locV of sprite the extentSprite of me
set the minScreen of me = the left of sprite the extentSprite of me
set the maxScreen of me = the right of sprite the extentSprite of me
set the locH of sprite handle to the newLocH of me
set the locV of sprite handle to the newLocV of me
set the valrange of me = the max of me - the min of me
set the extentlength of me = the maxScreen of me - the minScreen of me
end
on prepareFrame me
if tracking then
set handle = the spriteNum of me
set extent = the extentSprite of me
set the newLocH of me = the mouseH
set the newLocV of me = the locV of sprite extent
if the newLocH of me < the left of sprite extent then
set the newLocH of me = the left of sprite extent
end if
if the newLocH of me > the right of sprite extent then
set the newLocH of me = the right of sprite extent
end if
set the currentScreenVal of me = the newLocH of me - the minScreen of me
set the locH of sprite handle to the newLocH of me
set the locV of sprite handle to the newLocV of me
if the dynamic of me then
send_the_val me, compute_val (me)
end if
else -- end if tracking, control slider position by movieTime
set x = float(getvolume(sprite VideoSprite)+100)/ float(pDuration)
set handle = the spriteNum of me
set extent = the extentSprite of me
set ScreenX = the left of sprite extent + (x * (the right of sprite extent - the left of sprite extent))
set the newLocH of me = screenX
set the newLocV of me = the locV of sprite extent
if the newLocH of me < the left of sprite extent then
set the newLocH of me = the left of sprite extent
end if
if the newLocH of me > the right of sprite extent then
set the newLocH of me = the right of sprite extent
end if
set the currentScreenVal of me = the newLocH of me - the minScreen of me
set the locH of sprite handle to the newLocH of me
set the locV of sprite handle to the newLocV of me
end if
end
on mouseDown me
set tracking = TRUE
set temp = the member of sprite the spritenum of me
set the member of sprite the spritenum of me = member the hiliteMember of me
set the hiliteMember of me = temp
end
on mouseUp me
set tracking = FALSE
set temp = the member of sprite the spritenum of me
set the member of sprite the spritenum of me = member the hiliteMember of me
set the hiliteMember of me = temp
end
on mouseUpOutside me
set tracking = FALSE
set temp = the member of sprite the spritenum of me
set the member of sprite the spritenum of me = member the hiliteMember of me